From: David Reitter Date: Sun, 14 Jun 2009 22:29:15 +0000 (+0000) Subject: nsmenu.m (EmacsTooltip: setText): set height of tooltip. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~390 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=8e7f2f3117bc5973a9dfac57f4052334f42f57e1;p=emacs.git nsmenu.m (EmacsTooltip: setText): set height of tooltip. --- diff --git a/src/ChangeLog b/src/ChangeLog index 8253ae2405a..ae6479312fd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-06-14 Sidney Markowitz + + * nsmenu.m (EmacsTooltip: setText): set height of tooltip. + 2009-06-14 Adrian Robert * nsfont.m (ns_attribute_value): Remove. diff --git a/src/nsmenu.m b/src/nsmenu.m index 190bbb37624..aab3016e5e8 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1439,7 +1439,14 @@ update_frame_tool_bar (FRAME_PTR f) { NSString *str = [NSString stringWithUTF8String: text]; NSRect r = [textField frame]; - r.size.width = [[[textField font] screenFont] widthOfString: str] + 8; + NSSize textSize = [str sizeWithAttributes: + [NSDictionary dictionaryWithObject: [[textField font] screenFont] + forKey: NSFontAttributeName]]; + NSSize padSize = [[[textField font] screenFont] + boundingRectForFont].size; + + r.size.width = textSize.width + padSize.width/2; + r.size.height = textSize.height + padSize.height/2; [textField setFrame: r]; [textField setStringValue: str]; }